import lodash from 'lodash'
import config from './default'

let envConfig = null

try {
  envConfig = process.env.NODE_ENV === 'development' ?
    require('./development').default :
    (
      process.env.NODE_ENV === 'staging' ?
      require('./staging').default :
      require('./production').default
    )
} catch (o_o) {
  console.warn('used default config now')
}

if (envConfig) {
  lodash.merge(config, envConfig)
}

export default config
